package com.example.demo.Service.Impl;

import com.example.demo.Dao.UserMessageDao;
import com.example.demo.Entity.UserMessage;
import com.example.demo.Service.UserMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class UserMessageImpl implements UserMessageService {

    @Autowired
    private UserMessageDao userMessageDao;
    @Override
    public boolean createNewMessage(UserMessage userMessage) {
        userMessageDao.createNewMessage(userMessage);
        return true;
    }

    @Override
    public ArrayList<UserMessage> getMessage(String userId) {
        return userMessageDao.getMessage(userId);
    }

    @Override
    public UserMessage getLast(String userId) {
        return userMessageDao.getLast(userId);
    }
}
